<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>练习</title>
	<style>
	.anniu{
		width: 90px;
		height: 40px;
		background-color:#5DA4E6;
	}
	

	#div1{
		width: 200px;
		height: 200px;
		border: 1px solid black;
	}
	</style>

	<script type="text/javascript">
	window.onload=function(){
		var odiv1=document.getElementById("div1");
		var oyuan=document.getElementById("yuan");
		var ohuang=document.getElementById("huang");
		var ohong=document.getElementById("hong");
		var olan=document.getElementById("lan");

		function tocolor(co){
			div1.style.background=co;
		}

		oyuan.onclick=function(){
			tocolor("#fff")
		}
		ohuang.onclick=function(){
			tocolor("yellow");
		}

		ohong.onclick=function(){
			tocolor("red");
		}

		olan.onclick=function(){
			tocolor("blue");
		}



	}


	// function myfunction(x){
	// 	alert(x);
	// }

	// var run=function(){
	// 	var x=2;
	// 		y=3;
	// 		z=x+y;
	// 	document.write(z);
	// 	}
	

		// var a=1;
		// 	b=2;
		// 	c=4;
		// 	document.write(a+'<br>');
		// 	document.write(b+'<br>');


		// var i;
		// var cars=new Array();
		// 	cars[0]="cai";
		// 	cars[1]="shu";
		// 	cars[2]="wen";
		// 	for (var i =0; i < cars.length; i++) {
		// 		document.write(cars[i]+'<br>')
		// 	};





	</script>
</head>
<body>
	<input type="button" value="还原" id="yuan">
	<input type="button" value="变黄" id="huang">
	<input type="button" value="变红" id="hong">
	<input type="button" value="变蓝" id="lan">
	<div id="div1"></div>
	<input type="button" value="搜狗搜索" class="anniu">
	<input type="button" onclick="myfunction('晚安')" value=" 请点击" >
	<input type="button" value="开始计算" onclick="run">
</body>
</html>